// 用于验证码发送的状态管理

import { verification_code_fail, Verification_code_loading, Verification_code_success } from "../Type"

let verification_code_reducer ={
    state:'default',
    send:false,
    loading:false,
    // data:[]
}

const verification_code = (status=verification_code_reducer,action)=>{
    if(action.type === Verification_code_loading){
        return{
            state:action.msg,
            send:false,
            loading:true,
        }
    }
    if(action.type === Verification_code_success){
        return {
            state:action.msg,
            send:true,
            loading:true
        }
    }
    if(action.type === verification_code_fail){
        return {
            state:action.msg,
            send:false,
            loading:false,
        }
    }
    return status
}

export default verification_code